﻿namespace System
{
    public static class ExceptionExtensions
    {
        public static Exception GetInnerException(this Exception source)
        {
            while (source.InnerException != null)
            {
                source = source.InnerException;
            }

            return source;
        }
    }
}
